/**
 * Created by Administrator on 2017/12/12 0012.
 */
import React from 'react'
import {BrowserRouter as Router, Route, Link} from 'react-router-dom'
import Home from '@/pages/home'
import Page1 from '@/pages/Page'
import Dtime from '@/components/time'
// import Page2 from '@/pages/Page'

// const Home = () =>
//   ( <div >
//   <h2>首页</h2>
// </div>)
//
//
// const Page1 = () => (
//   <div >
//     <h2>Page1</h2>
//   </div>
// )
//
//
const Page2 = ({match}) => {
  return(
    <div>
      <h2>ID:{match.params.id}</h2>
    </div>
  )
}
const basic = () => {
  return (
    <Router>
      <div>
        <ul>
          <li><Link to="/">Home</Link></li>
          <li><Link to="/page1">Page1</Link></li>
          <li><Link to="/page2/546545">Page2</Link></li>
          <li><Link to="/time">time</Link></li>
        </ul>
        <hr/>
        <Route exact path="/" component={Home}/>
        <Route path="/page1" component={Page1}/>
        <Route path="/page2/:id" component={Page2}/>
        <Route path="/time" component={Dtime}/>
      </div>
    </Router>
  )
}


export default basic;
